package b3.config
{
	public class BirdConfig extends BasicConfig
	{
		public var index:int;
		public var objAppearHeightRange:Array;
		public var objAppearClass:Array;
		public var objAppearPossibility:Array;

		public function BirdConfig(birdXML:XML = null)
		{
			if (birdXML != null)
			{
				index = birdXML.index;
				objAppearHeightRange = new Array();
				objAppearClass = new Array();
				objAppearPossibility = new Array();
				for (var i:int = 0; i < birdXML.objAppear.length(); i++)
				{
					objAppearClass.push(String(birdXML.objAppear[i].className));
					objAppearPossibility.push(parseFloat(birdXML.objAppear[i].possibility));
					var heightRanges:Array = birdXML.objAppear[i].heightRange.split(",");
					for (var j:int = 0; j < 2; j++)
					{
						objAppearHeightRange.push(parseFloat(heightRanges[j]));
					}
				}
			}
		}
		
		public function copy():BirdConfig
		{
			var birdConfig:BirdConfig = new BirdConfig();
			 birdConfig.index = this.index;
			 birdConfig.objAppearHeightRange = this.objAppearHeightRange.concat();
			 birdConfig.objAppearClass = this.objAppearClass.concat();
			 birdConfig.objAppearPossibility = this.objAppearPossibility.concat();
			 return birdConfig;
		}
		
	}
}